home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 626-637 / disk_633 / galer / source / galertest.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  4KB  |  167 lines

  1. /****************************************************************/
  2. /*                                */
  3. /* Testprogramm für GAL-Brenner                    */
  4. /*                                */
  5. /* Soft- and Hardware  copyright (c)1991            */
  6. /*     by Christian Habermann                    */
  7. /*        Asamstr. 17                        */
  8. /*        8050 Freising (W-Germany)                */
  9. /*                                */
  10. /*  cc GALerTest.c                        */
  11. /*  as -n -c -d port.asm                    */
  12. /*  ln GALerTest.o port.o -lc                    */
  13. /*                                */
  14. /****************************************************************/
  15.  
  16.  
  17. #define        GAL16V8        1
  18. #define        GAL20V8        2
  19. #define        IC1        3
  20. #define        IC3        0
  21. #define        IC4        1
  22. #define        IC5        2
  23. #define        IC6        0
  24. #define        IC7        1
  25. #define        ON        1
  26. #define        OFF        0
  27.  
  28.  
  29. main()
  30. {
  31.  
  32.  
  33.  InitGALer();
  34.  printf("Testprogramm für GAL-Brenner\n\n");
  35.  printf("Bitte messen Sie alle angegebnen Spannung an der Textool-Fassung\n");
  36.  printf("(die Fassung, in die Sie später die zu programmierenden GALs einsetzen) nach.\n");
  37.  printf("In dieser Fassung darf sich jetzt noch KEIN GAL befinden!!!\n\n");
  38.  
  39.  printf("Jetzt darf an keinem Pin der Textool-Fassung eine Spannung anliegen.\n");
  40.  printf("Außerdem soll die LED aus sein.\n");
  41.  printf("WEITER MIT LINKER MAUSTASTE !!!\n\n");
  42.  EnableOutput();
  43.  WriteByte(0x00,IC3);
  44.  WriteByte(0x00,IC4);
  45.  WriteByte(0x00,IC5);
  46.  WaitMouse();
  47.  
  48.  
  49.  Delay(25L);
  50.  printf("Jetzt soll die LED blinken\n");
  51.  printf("WEITER MIT LINKER MAUSTASTE !!!\n\n");
  52. #asm
  53. loopuntilmouse:
  54. #endasm
  55.    LED(ON);
  56.    Delay(10L);
  57. #asm
  58.  btst    #6,$bfe001
  59.  beq.s    endofloop
  60. #endasm
  61.    LED(OFF);
  62.    Delay(10L);
  63. #asm
  64.  btst    #6,$bfe001
  65.  beq.s    endofloop
  66.  bra loopuntilmouse
  67. endofloop:
  68. #endasm
  69.  
  70.  
  71.  Delay(25L);
  72.  printf("An Pin 24 sollten jetzt ca. +5V anliegen\n");
  73.  printf("WEITER MIT LINKER MAUSTASTE !!!\n\n");
  74.  SetGAL(GAL20V8);
  75.  EnableVcc();
  76.  WaitMouse();
  77.  
  78.  
  79.  Delay(25L);
  80.  printf("An Pin 22 sollten jetzt ebenfalls ca. +5V anliegen\n");
  81.  printf("WEITER MIT LINKER MAUSTASTE !!!\n\n");
  82.  DisableVcc();
  83.  SetGAL(GAL16V8);
  84.  EnableVcc();
  85.  WaitMouse();
  86.  
  87.  
  88.  Delay(25L);
  89.  printf("Die +5V sollten wieder weg sein und dafür\n");
  90.  printf("an Pin 2 +16.5V anliegen. (mit Spindeltrimmer auf 16.5 V einstellen)\n");
  91.  printf("WEITER MIT LINKER MAUSTASTE !!!\n\n");
  92.  DisableVcc();
  93.  SetGAL(GAL20V8);
  94.  VeditOn();
  95.  EnableVEdit();
  96.  WaitMouse();
  97.  
  98.  
  99.  Delay(25L);
  100.  printf("An Pin 2 sollten die +16.5V wieder weg sein und dafür\n");
  101.  printf("an Pin 4 anliegen.\n");
  102.  printf("WEITER MIT LINKER MAUSTASTE !!!\n\n");
  103.  DisableVEdit();
  104.  SetGAL(GAL16V8);
  105.  EnableVEdit();
  106.  WaitMouse();
  107.  
  108.  
  109.  Delay(25L);
  110.  printf("Jetzt sollte an allen Pins ca. +5V anliegen, außer an Pin 12\n");
  111.  printf("WEITER MIT LINKER MAUSTASTE !!!\n\n");
  112.  InitGALer();
  113.  EnableOutput();
  114.  WriteByte(0xff,IC3);
  115.  WriteByte(0xff,IC4);
  116.  WriteByte(0xff,IC5);
  117.  WaitMouse();
  118.  
  119.  
  120.  Delay(25L);
  121.  printf("Jetzt sollten ab Pin 1 abwechselnd +5V,0V,+5V,0V usw. anliegen (ohne Pin 12)\n");
  122.  printf("WEITER MIT LINKER MAUSTASTE !!!\n\n");
  123.  SetGAL(GAL20V8);
  124.  EnableVcc();
  125.  WriteByte(0x55,IC3);
  126.  WriteByte(0x55,IC4);
  127.  WriteByte(0x55,IC5);
  128.  WaitMouse();
  129.  
  130.  
  131.  Delay(25L);
  132.  printf("Jetzt das ganze invertiert (ohne Pin 12)\n");
  133.  printf("WEITER MIT LINKER MAUSTASTE !!!\n\n");
  134.  DisableVcc();
  135.  WriteByte(0xaa,IC3);
  136.  WriteByte(0xaa,IC4);
  137.  WriteByte(0xaa,IC5);
  138.  
  139.  WaitMouse();
  140.  DisableVcc();
  141.  DisableOutput(); 
  142.  printf("Wenn alle Spannung korrekt waren und Sie die Programmierspannung\n");
  143.  printf("von 16.5V eingestellt haben (mit Spindeltrimmer R16) dann\n");
  144.  printf("funktioniert die Hardware sehr wahrscheinlich fehlerfrei.\n");
  145.  printf("Letzte Gewißheit bekommen Sie, wenn Sie probeweise einige GALs\n");
  146.  printf("programmieren und anschließend austesten.\n");
  147. }
  148.  
  149.  
  150.  
  151. WaitMouse()
  152. {
  153. #asm
  154. loop    btst.b    #6,$bfe001
  155.     bne.s    loop
  156. #endasm
  157. }
  158.  
  159.  
  160.  
  161.  
  162. WaitForTimer()            /*dummy für port.asm*/
  163. {
  164. }
  165.  
  166.  
  167.